home *** CD-ROM | disk | FTP | other *** search
- global mouseEnabled, mouseTimer, alarmval, alarmon, shockTime, tick, bignil, beeps, mouseVal, mouseCycle
-
- on alarmInit
- set mouseEnabled to 0
- set mouseTimer to the timer
- set alarmval to [#hour: 0, #minute: 0, #second: 0]
- set alarmon to 0
- end
-
- on alarm
- set hour to the hour of alarmval
- set twelveHrMode to the twelveHrMode of shockTime
- if twelveHrMode then
- set pm to hour > 11
- set hour to 1 + ((hour - 1) mod 12)
- if not hour then
- set hour to 12
- end if
- end if
- donum(1, bignil, the pad of shockTime, hour)
- donum(4, bignil, 1, the minute of alarmval)
- donum(7, bignil, 1, the second of alarmval)
- ampm(twelveHrMode, pm, 1)
- set tick to 1
- time(0)
- end
-
- on checkAlarm
- if alarmon then
- set hour to the hour of shockTime
- if the twelveHrMode of shockTime then
- set hour to (hour mod 12) + (12 * the pm of shockTime)
- end if
- if (hour = the hour of alarmval) and (the minute of shockTime = the minute of alarmval) and (the second of shockTime = the second of alarmval) then
- set beeps to 15
- end if
- end if
- end
-
- on checkMouse
- if mouseEnabled and the mouseDown then
- set enabled to rollOver(the clickOn)
- if enabled and (the timer > (mouseTimer + 30 - (mouseCycle * 2))) then
- set mouseCycle to mouseCycle + 1
- do(the frameLabel & "inc")
- updateStage()
- set mouseTimer to the timer
- end if
- else
- set mouseEnabled to 0
- set enabled to 0
- end if
- return enabled
- end
-
- on alarmInc
- inc(alarmval, 24, 0)
- set alarmval to the result
- alarm()
- end
-
- on inc orig, modval, docarry
- set total to [#hour: 0, #minute: 0, #second: 0]
- set sec to the second of orig + the second of mouseVal
- set carry1 to docarry * ((sec > 59) - (sec < 0))
- set the second of total to (sec + 60) mod 60
- set min to the minute of orig + the minute of mouseVal + carry1
- set carry2 to docarry * ((min > 59) - (min < 0))
- set the minute of total to (min + 60) mod 60
- set the hour of total to (the hour of orig + the hour of mouseVal + modval + carry2) mod modval
- set tick to 1
- return total
- end
-
- on indicatealarm
- if beeps then
- set x to the number of cast "beepon"
- else
- set x to the number of cast "alarmoff" + alarmon
- end if
- set the castNum of sprite 18 to x
- set the visible of sprite 18 to alarmon or beeps
- updateStage()
- end
-